/*
 *  This file is part of Spidex.
 *  
 *  Spidex is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Spidex is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Spidex.  If not, see <http://www.gnu.org/licenses/>.
 */

package spidex.dbmanager;

/**
 *
 * @author xatrix
 */
public class MediaType {
    private final int type;
    private final String stringType;
    
    private MediaType(int type, String stringType) {
        this.type = type;
        this.stringType = stringType;
    }
    
    public int getInt() {
        return this.type;
    }

    public final static MediaType DVD = new MediaType(0,"DVD");
    public final static MediaType BluRay = new MediaType(1,"Blu-ray");
    public final static MediaType HDDVD = new MediaType(2,"HD-DVD");
    public final static MediaType VHS = new MediaType(3,"VHS");
    public final static MediaType Other = new MediaType(4,"Other");
    
    public final static MediaType getType(int value) {
        switch(value) {
            case 0: return MediaType.DVD;
            case 1: return MediaType.BluRay;
            case 2: return MediaType.HDDVD;
            case 3: return MediaType.VHS;
            case 4: return MediaType.Other;
            default: return MediaType.DVD;
            
        }
    }
    
    public boolean equals(MediaType val) {
        return ((Integer) this.type).equals( val.type );
    }
    
    @Override
    public String toString() {
        return this.stringType;
    }
} 